package easeui.widget.chatrow;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.github.postsanf.yinian.R;
import com.github.postsanf.yinian.bean.YNHistory;
import com.hyphenate.EMCallBack;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.chat.EMMessage.ChatType;
import com.hyphenate.chat.EMNormalFileMessageBody;
import com.hyphenate.exceptions.HyphenateException;
import com.hyphenate.util.FileUtils;
import com.hyphenate.util.TextFormater;

import java.io.File;

import easeui.ui.EaseShowNormalFileActivity;

public class EaseChatRowHistoryFile2 extends EaseChatHistoryRow2 {

    protected TextView fileNameView;
	protected TextView fileSizeView;
    protected TextView fileStateView;

    protected EMCallBack sendfileCallBack;

    protected boolean isNotifyProcessed;
    private EMNormalFileMessageBody fileMessageBody;
    private int direction;

    public EaseChatRowHistoryFile2(Context context, YNHistory message, int position, BaseAdapter adapter) {
		super(context, message, position, adapter);
	}



	@Override
	protected void onInflateView() {
        direction = message.getFrom().equals(String.valueOf(application.getCurID())) ? 0 : 1;
	    inflater.inflate(direction == 1 ?
	            R.layout.ease_row_received_file : R.layout.ease_row_sent_file, this);
	}

	@Override
	protected void onFindViewById() {
	    fileNameView = (TextView) findViewById(R.id.tv_file_name);
        fileSizeView = (TextView) findViewById(R.id.tv_file_size);
        fileStateView = (TextView) findViewById(R.id.tv_file_state);
        percentageView = (TextView) findViewById(R.id.percentage);
	}


	@Override
	protected void onSetUpView() {
	}

	/**
	 * handle sending message
	 */

	@Override
    protected void onUpdateView() {
        adapter.notifyDataSetChanged();
    }

    @Override
    protected void onBubbleClick() {

    }
}
